CREATE OR REPLACE PROCEDURE example_one IS
  v_hdl    NUMBER; v_th1  NUMBER; v_th2  NUMBER;
  v_doc  sys.ku$_ddls;
BEGIN
  v_hdl := DBMS_METADATA.OPEN('SCHEMA_EXPORT');
  DBMS_METADATA.SET_FILTER (v_hdl,'SCHEMA','OE');
  v_th1 := DBMS_METADATA.ADD_TRANSFORM (v_hdl,
    'MODIFY', NULL, 'TABLE');
  DBMS_METADATA.SET_REMAP_PARAM(v_th1,
    'REMAP_TABLESPACE', 'SYSTEM', 'TBS1');
  v_th2 :=DBMS_METADATA.ADD_TRANSFORM(v_hdl,'DDL');
  DBMS_METADATA.SET_TRANSFORM_PARAM(v_th2,
    'SQLTERMINATOR', TRUE);
  DBMS_METADATA.SET_TRANSFORM_PARAM(v_th2,
    'REF_CONSTRAINTS', FALSE, 'TABLE');
  LOOP
    v_doc := DBMS_METADATA.FETCH_DDL(v_hdl);
    EXIT WHEN v_doc IS NULL;
  END LOOP;
  DBMS_METADATA.CLOSE(v_hdl);
END;
/
